import 'package:easydouban/generated/json/base/json_convert_content.dart';
import 'package:easydouban/bean/i_top_entity.dart';

ITopEntity $ITopEntityFromJson(Map<String, dynamic> json) {
	final ITopEntity iTopEntity = ITopEntity();
	final List<ITopData>? data = jsonConvert.convertListNotNull<ITopData>(json['data']);
	if (data != null) {
		iTopEntity.data = data;
	}
	final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
	if (createdAt != null) {
		iTopEntity.createdAt = createdAt;
	}
	final int? updatedAt = jsonConvert.convert<int>(json['updatedAt']);
	if (updatedAt != null) {
		iTopEntity.updatedAt = updatedAt;
	}
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		iTopEntity.id = id;
	}
	final String? originalName = jsonConvert.convert<String>(json['originalName']);
	if (originalName != null) {
		iTopEntity.originalName = originalName;
	}
	final int? imdbVotes = jsonConvert.convert<int>(json['imdbVotes']);
	if (imdbVotes != null) {
		iTopEntity.imdbVotes = imdbVotes;
	}
	final String? imdbRating = jsonConvert.convert<String>(json['imdbRating']);
	if (imdbRating != null) {
		iTopEntity.imdbRating = imdbRating;
	}
	final String? rottenRating = jsonConvert.convert<String>(json['rottenRating']);
	if (rottenRating != null) {
		iTopEntity.rottenRating = rottenRating;
	}
	final int? rottenVotes = jsonConvert.convert<int>(json['rottenVotes']);
	if (rottenVotes != null) {
		iTopEntity.rottenVotes = rottenVotes;
	}
	final String? year = jsonConvert.convert<String>(json['year']);
	if (year != null) {
		iTopEntity.year = year;
	}
	final String? imdbId = jsonConvert.convert<String>(json['imdbId']);
	if (imdbId != null) {
		iTopEntity.imdbId = imdbId;
	}
	final String? alias = jsonConvert.convert<String>(json['alias']);
	if (alias != null) {
		iTopEntity.alias = alias;
	}else{
		iTopEntity.alias = '';
	}
	final String? doubanId = jsonConvert.convert<String>(json['doubanId']);
	if (doubanId != null) {
		iTopEntity.doubanId = doubanId;
	}
	final String? type = jsonConvert.convert<String>(json['type']);
	if (type != null) {
		iTopEntity.type = type;
	}
	final String? doubanRating = jsonConvert.convert<String>(json['doubanRating']);
	if (doubanRating != null) {
		iTopEntity.doubanRating = doubanRating;
	}
	final int? doubanVotes = jsonConvert.convert<int>(json['doubanVotes']);
	if (doubanVotes != null) {
		iTopEntity.doubanVotes = doubanVotes;
	}
	final int? duration = jsonConvert.convert<int>(json['duration']);
	if (duration != null) {
		iTopEntity.duration = duration;
	}
	final String? dateReleased = jsonConvert.convert<String>(json['dateReleased']);
	if (dateReleased != null) {
		iTopEntity.dateReleased = dateReleased;
	}
	return iTopEntity;
}

Map<String, dynamic> $ITopEntityToJson(ITopEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	data['createdAt'] = entity.createdAt;
	data['updatedAt'] = entity.updatedAt;
	data['id'] = entity.id;
	data['originalName'] = entity.originalName;
	data['imdbVotes'] = entity.imdbVotes;
	data['imdbRating'] = entity.imdbRating;
	data['rottenRating'] = entity.rottenRating;
	data['rottenVotes'] = entity.rottenVotes;
	data['year'] = entity.year;
	data['imdbId'] = entity.imdbId;
	data['alias'] = entity.alias;
	data['doubanId'] = entity.doubanId;
	data['type'] = entity.type;
	data['doubanRating'] = entity.doubanRating;
	data['doubanVotes'] = entity.doubanVotes;
	data['duration'] = entity.duration;
	data['dateReleased'] = entity.dateReleased;
	return data;
}

ITopData $ITopDataFromJson(Map<String, dynamic> json) {
	final ITopData iTopData = ITopData();
	final int? createdAt = jsonConvert.convert<int>(json['createdAt']);
	if (createdAt != null) {
		iTopData.createdAt = createdAt;
	}
	final int? updatedAt = jsonConvert.convert<int>(json['updatedAt']);
	if (updatedAt != null) {
		iTopData.updatedAt = updatedAt;
	}
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		iTopData.id = id;
	}
	final String? poster = jsonConvert.convert<String>(json['poster']);
	if (poster != null) {
		iTopData.poster = poster;
	}
	final String? shareImage = jsonConvert.convert<String>(json['shareImage']);
	if (shareImage != null) {
		iTopData.shareImage = shareImage;
	}else{
		iTopData.shareImage = '';
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		iTopData.name = name;
	}
	final String? genre = jsonConvert.convert<String>(json['genre']);
	if (genre != null) {
		iTopData.genre = genre;
	}
	final String? description = jsonConvert.convert<String>(json['description']);
	if (description != null) {
		iTopData.description = description;
	}
	final String? language = jsonConvert.convert<String>(json['language']);
	if (language != null) {
		iTopData.language = language;
	}
	final String? country = jsonConvert.convert<String>(json['country']);
	if (country != null) {
		iTopData.country = country;
	}
	final String? lang = jsonConvert.convert<String>(json['lang']);
	if (lang != null) {
		iTopData.lang = lang;
	}
	final String? movie = jsonConvert.convert<String>(json['movie']);
	if (movie != null) {
		iTopData.movie = movie;
	}
	return iTopData;
}

Map<String, dynamic> $ITopDataToJson(ITopData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['createdAt'] = entity.createdAt;
	data['updatedAt'] = entity.updatedAt;
	data['id'] = entity.id;
	data['poster'] = entity.poster;
	data['shareImage'] = entity.shareImage;
	data['name'] = entity.name;
	data['genre'] = entity.genre;
	data['description'] = entity.description;
	data['language'] = entity.language;
	data['country'] = entity.country;
	data['lang'] = entity.lang;
	data['movie'] = entity.movie;
	return data;
}